home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Various / DevDisk 65 (1989)(DevWare PD).zip / DevDisk 65 (1989)(DevWare PD).adf / prosuite / opendata.c < prev    next >
C/C++ Source or Header  |  1990-07-11  |  15KB  |  826 lines

  1.  
  2. /* *** opendata.c ***********************************************************
  3.  *
  4.  * File IO Suite  --  Open Requester Data
  5.  *     from Book 1 of the Amiga Programmers' Suite by RJ Mical
  6.  *
  7.  * Copyright (C) 1986, 1987, Robert J. Mical
  8.  * All Rights Reserved.
  9.  *
  10.  * Created for Amiga developers.
  11.  * Any or all of this code can be used in any program as long as this
  12.  * entire copyright notice is retained, ok?  Thanks.
  13.  *
  14.  * The Amiga Programmer's Suite Book 1 is copyrighted but freely distributable.
  15.  * All copyright notices and all file headers must be retained intact.
  16.  * The Amiga Programmer's Suite Book 1 may be compiled and assembled, and the 
  17.  * resultant object code may be included in any software product.  However, no 
  18.  * portion of the source listings or documentation of the Amiga Programmer's 
  19.  * Suite Book 1 may be distributed or sold for profit or in a for-profit 
  20.  * product without the written authorization of the author, RJ Mical.
  21.  * 
  22.  * HISTORY      NAME            DESCRIPTION
  23.  * -----------  --------------  --------------------------------------------
  24.  * 18 Aug 87    RJ              Removed SELECTED from most string gadgets
  25.  * 18 Aug 87    RJ              Added KeyHandler field to ReqSupport
  26.  * 12 Aug 86    RJ >:-{)*       Prepare (clean house) for release
  27.  * 3 May 86     =RJ Mical=      Fix prop gadget for both 1.1 and 1.2
  28.  * 1 Feb 86     =RJ Mical=      Created this file.
  29.  *
  30.  * *********************************************************************** */
  31.  
  32.  
  33. #define FILEIO_SOURCEFILE
  34. #include "fileio.h"
  35.  
  36.  
  37.  
  38.  
  39. struct TextAttr SafeFont =
  40.     {
  41.     (UBYTE *)"topaz.font",
  42.     TOPAZ_EIGHTY,
  43.     0,
  44.     0,
  45.     };
  46.  
  47.  
  48.  
  49. /* This is where the Select text is kept!  This array of text will be
  50.  * redrawn every time we want Intuition to redraw the lowly SelectGadget.
  51.  * The strings themselves are kept in OpenSelectBuffers where 
  52.  * the open routines make sure that the buffers are padded with
  53.  * blanks and are always null-terminated.  Ha ha!  Like madmen
  54.  * dancing, like crazy monkeys.
  55.  */
  56. UBYTE OpenSelectBuffers[NAME_ENTRY_COUNT][VISIBLE_SELECT_LENGTH];
  57. struct IntuiText OpenSelectText[NAME_ENTRY_COUNT] =
  58.     {
  59.         {
  60.         1, 0, 
  61.         JAM2,
  62.         1, 1 + (OPEN_LINEHEIGHT * 0),
  63.         &SafeFont,
  64.         &OpenSelectBuffers[0][0],
  65.         NULL,
  66.         },
  67.  
  68.         {
  69.         1, 0, 
  70.         JAM2,
  71.         1, 1 + (OPEN_LINEHEIGHT * 1),
  72.         &SafeFont,
  73.         &OpenSelectBuffers[1][0],
  74.         &OpenSelectText[0],
  75.         },
  76.  
  77.         {
  78.         1, 0, 
  79.         JAM2,
  80.         1, 1 + (OPEN_LINEHEIGHT * 2),
  81.         &SafeFont,
  82.         &OpenSelectBuffers[2][0],
  83.         &OpenSelectText[1],
  84.         },
  85.  
  86.         {
  87.         1, 0, 
  88.         JAM2,
  89.         1, 1 + (OPEN_LINEHEIGHT * 3),
  90.         &SafeFont,
  91.         &OpenSelectBuffers[3][0],
  92.         &OpenSelectText[2],
  93.         },
  94.  
  95.         {
  96.         1, 0, 
  97.         JAM2,
  98.         1, 1 + (OPEN_LINEHEIGHT * 4),
  99.         &SafeFont,
  100.         &OpenSelectBuffers[4][0],
  101.         &OpenSelectText[3],
  102.         },
  103.  
  104.         {
  105.         1, 0, 
  106.         JAM2,
  107.         1, 1 + (OPEN_LINEHEIGHT * 5),
  108.         &SafeFont,
  109.         &OpenSelectBuffers[5][0],
  110.         &OpenSelectText[4],
  111.         },
  112.  
  113.     };
  114.  
  115.  
  116.  
  117.  
  118. /* === Backdrop Gadget =================================================== */
  119. /* We shouldn't need this gadget.  It's sole purpose is to allow the user 
  120.  * to cancel the filename building operation by clicking outside any of 
  121.  * the regular requester gadgets.  Why, we may ask, don't we just make 
  122.  * the requester a NOISYREQ and detect SELECTDOWN.  Well, we tried that, 
  123.  * and either there's something wrong with our brains or 1.2 Intuition has 
  124.  * a bug that doesn't broadcast SELECTDOWN to requester listeners.  
  125.  * It broadcasts SELECTUP, MENUDOWN and MENUUP jes' fine, but no DOWN.  
  126.  * Bummer.  So anyway, now we got an imageless, highlightless gadget that 
  127.  * fills up the entire requester but, being at the back of the list, won't 
  128.  * be hit unless all other gadgets are missed.  
  129.  * Having a wonderful time, wish you were here.
  130.  */
  131. struct Gadget BackdropGadget =
  132.     {
  133.     NULL,
  134.     0, 0, 
  135.     OPEN_WIDTH, OPEN_HEIGHT, 
  136.     GADGHNONE,                /* Flags */
  137.     GADGIMMEDIATE,            /* Activation */
  138.     REQGADGET | BOOLGADGET,    /* Type */
  139.     NULL,                     /* GadgetRender */
  140.     NULL,                    /* SelectRender */
  141.     NULL,
  142.     NULL, NULL, 
  143.     OPENGADGET_BACKDROP, 
  144.     NULL,
  145.     };
  146.  
  147.  
  148.  
  149. /* === OK, Cancel, and NextDisk Gadgets ================================== */
  150. SHORT BoolCluster3Pairs[] =
  151.     {
  152.     0, -3, 
  153.     55, -3,
  154.     57, -1,
  155.     57, 19,
  156.     55, 21,
  157.     -1, 21,
  158.     -3, 19,
  159.     -3, -1,
  160.     -1, -3,
  161.     };
  162.  
  163. SHORT BoolCluster2Pairs[] =
  164.     {
  165.     -2, -1,
  166.     56, -1,
  167.     56, 19,
  168.     -2, 19,
  169.     -2, -1,
  170.     };
  171.  
  172. SHORT BoolClusterPairs[] =
  173.     {
  174.     -1, -2,
  175.     55, -2,
  176.     55, 20,
  177.     -1, 20,
  178.     -1, -2,
  179.     };
  180.  
  181. struct Border BoolCluster3Border =
  182.     {
  183.     1, 1,
  184.     2, 0,
  185.     JAM1,
  186.     9,
  187.     &BoolCluster3Pairs[0],
  188.     NULL,
  189.     };
  190.  
  191. struct Border BoolCluster2Border =
  192.     {
  193.     1, 1,
  194.     1, 0,
  195.     JAM1,
  196.     5,
  197.     &BoolCluster2Pairs[0],
  198.     &BoolCluster3Border,
  199.     };
  200.  
  201. struct Border BoolClusterBorder =
  202.     {
  203.     1, 1,
  204.     1, 0,
  205.     JAM1,
  206.     5,
  207.     &BoolClusterPairs[0],
  208.     &BoolCluster2Border,
  209.     };
  210.  
  211. struct IntuiText NextDisk2Text =
  212.     {
  213.     1, 0, 
  214.     JAM2,
  215.     13, 11,
  216.     &SafeFont,
  217.     (UBYTE *)"DISK",
  218.     NULL,
  219.     };
  220.  
  221. struct IntuiText NextDiskText =
  222.     {
  223.     1, 0, 
  224.     JAM2,
  225.     13, 3,
  226.     &SafeFont,
  227.     (UBYTE *)"NEXT",
  228.     &NextDisk2Text,
  229.     };
  230.  
  231. struct IntuiText CancelText =
  232.     {
  233.     1, 0, 
  234.     JAM2,
  235.     5, 7,
  236.     &SafeFont,
  237.     (UBYTE *)"CANCEL",
  238.     NULL,
  239.     };
  240.  
  241. struct IntuiText OK2Text =
  242.     {
  243.     1, 0, 
  244.     JAM2,
  245.     17, 7,
  246.     &SafeFont,
  247.     (UBYTE *)"OK!",
  248.     NULL,
  249.     };
  250.  
  251.  
  252. struct Gadget NextDiskGadget =
  253.     {
  254.     &BackdropGadget,
  255.     197, 82 + REQTITLE_HEIGHT,
  256.     57, 21,
  257.     GADGHCOMP,    /* Flags */
  258.     RELVERIFY,        /* Activation */
  259.     REQGADGET | BOOLGADGET,        /* Type */
  260.     (APTR)&BoolClusterBorder,             /* GadgetRender */
  261.     NULL,                /* SelectRender */
  262.     &NextDiskText,
  263.     NULL, NULL, 
  264.     OPENGADGET_NEXTDISK, 
  265.     NULL,
  266.     };
  267.  
  268. struct Gadget CancelGadget =
  269.     {
  270.     &NextDiskGadget,
  271.     114, 82 + REQTITLE_HEIGHT,
  272.     57, 21,
  273.     GADGHCOMP,    /* Flags */
  274.     RELVERIFY | ENDGADGET,        /* Activation */
  275.     REQGADGET | BOOLGADGET,        /* Type */
  276.     (APTR)&BoolClusterBorder,             /* GadgetRender */
  277.     NULL,                /* SelectRender */
  278.     &CancelText,
  279.     NULL, NULL, 
  280.     OPENGADGET_CANCEL,
  281.     NULL,
  282.     };
  283.  
  284. struct Gadget OKGadget =
  285.     {
  286.     &CancelGadget,
  287.     32, 82 + REQTITLE_HEIGHT,
  288.     57, 21,
  289.     GADGHCOMP,        /* Flags */
  290.     RELVERIFY | ENDGADGET,        /* Activation */
  291.     REQGADGET | BOOLGADGET,        /* Type */
  292.     (APTR)&BoolClusterBorder, 
  293.     NULL,                /* Renders */
  294.     &OK2Text,
  295.     NULL, NULL, 
  296.     OPENGADGET_OK, 
  297.     NULL,
  298.     };
  299.  
  300.  
  301.  
  302. /* === OpenUp ============================================================= */
  303.  
  304. struct Image OpenUpImage =
  305.     {
  306.     1, -1,
  307.     15, 14,
  308.     2,
  309.     &OpenUpData[0],
  310.     0x03, 0x00,
  311.     NULL,
  312.     };
  313.  
  314. struct Gadget OpenUpGadget =
  315.     {
  316.     &OKGadget,
  317.     134, 14 + REQTITLE_HEIGHT,
  318.     15, 12,
  319.     GADGIMAGE | GADGHNONE,              /* Flags */
  320.     GADGIMMEDIATE,                      /* Activation */
  321.     REQGADGET | BOOLGADGET,             /* Type */
  322.     (APTR)&OpenUpImage, 
  323.     NULL,                               /* Renders */
  324.     NULL,
  325.     NULL, NULL, 
  326.     OPENGADGET_UPGADGET, 
  327.     NULL,
  328.     };
  329.  
  330.  
  331.  
  332. /* === OpenDown =========================================================== */
  333.  
  334. struct Image OpenDownImage =
  335.     {
  336.     1, -1,
  337.     15, 14,
  338.     2,
  339.     &OpenDownData[0],
  340.     0x03, 0x00,
  341.     NULL,
  342.     };
  343.  
  344. struct Gadget OpenDownGadget =
  345.     {
  346.     &OpenUpGadget,
  347.     134, 64 + REQTITLE_HEIGHT,
  348.     15, 12,
  349.     GADGIMAGE | GADGHNONE,              /* Flags */
  350.     GADGIMMEDIATE,                          /* Activation */
  351.     REQGADGET | BOOLGADGET,             /* Type */
  352.     (APTR)&OpenDownImage, 
  353.     NULL,                               /* Renders */
  354.     NULL,
  355.     NULL, NULL, 
  356.     OPENGADGET_DOWNGADGET, 
  357.     NULL,
  358.     };
  359.  
  360.  
  361. /* === OpenDrawerText ==================================================== */
  362.  
  363. struct StringInfo OpenDrawerTextInfo =
  364.     {
  365.     NULL, /* Must be supplied from the appropriate FileIOSupport structure */
  366.     &OpenUndoBuffer[0],
  367.     0,
  368.     MAX_NAME_LENGTH,
  369.     0,
  370.     0,0,0,0,0,0,0,0,
  371.     };
  372.  
  373. struct Gadget OpenDrawerTextGadget =
  374.     {
  375.     &OpenDownGadget,
  376.     157, 41 + REQTITLE_HEIGHT,
  377.     122, 10,
  378.     GADGHCOMP,               /* Flags */
  379.     RELVERIFY | STRINGCENTER,               /* Activation */
  380.     REQGADGET | STRGADGET,              /* Type */
  381.     NULL, NULL,                         /* Renders */
  382.     NULL,
  383.     NULL,
  384.     (APTR)&OpenDrawerTextInfo,
  385.     OPENGADGET_DRAWERTEXT,
  386.     NULL,
  387.     };
  388.  
  389.  
  390. /* === OpenDiskText ====================================================== */
  391.  
  392. struct StringInfo OpenDiskTextInfo =
  393.     {
  394.     NULL, /* Must be supplied from the appropriate FileIOSupport structure */
  395.     &OpenUndoBuffer[0],
  396.     0,
  397.     MAX_NAME_LENGTH,
  398.     0,
  399.     0,0,0,0,0,0,0,0,
  400.     };
  401.  
  402. struct Gadget OpenDiskTextGadget =
  403.     {
  404.     &OpenDrawerTextGadget,
  405.     157, 65 + REQTITLE_HEIGHT,
  406.     122, 10,
  407.     GADGHCOMP,               /* Flags */
  408.     RELVERIFY | STRINGCENTER,               /* Activation */
  409.     REQGADGET | STRGADGET,              /* Type */
  410.     NULL, NULL,                         /* Renders */
  411.     NULL,
  412.     NULL,
  413.     (APTR)&OpenDiskTextInfo,
  414.     OPENGADGET_DISKTEXT,
  415.     NULL,
  416.     };
  417.  
  418.  
  419.  
  420. /* === OpenNameText ====================================================== */
  421.  
  422. struct StringInfo OpenNameTextInfo =
  423.     {
  424.     NULL, /* Must be supplied from the appropriate FileIOSupport structure */
  425.     &OpenUndoBuffer[0],
  426.     0,
  427.     MAX_NAME_LENGTH,
  428.     0,
  429.     0,0,0,0,0,0,0,0,
  430.     };
  431.  
  432. struct Gadget OpenNameTextGadget =
  433.     {
  434.     &OpenDiskTextGadget,
  435.     157, 16 + REQTITLE_HEIGHT,
  436.     122, 10,
  437.     GADGHCOMP | SELECTED,               /* Flags */
  438.     RELVERIFY | ENDGADGET | STRINGCENTER,               /* Activation */
  439.     REQGADGET | STRGADGET,              /* Type */
  440.     NULL, NULL,                         /* Renders */
  441.     NULL,
  442.     NULL,
  443.     (APTR)&OpenNameTextInfo,
  444.     OPENGADGET_NAMETEXT,
  445.     NULL,
  446.     };
  447.  
  448.  
  449. /* === OpenProp =========================================================== */
  450. /* OpenPropData[] is in chipdata.c */
  451.  
  452. struct Image OpenPropImage =
  453.     {
  454.     1, 0,
  455.     11, 8,
  456.     2,
  457.     &OpenPropData[0],
  458.     0x03, 0x00,
  459.     NULL,
  460.     };
  461.  
  462. struct PropInfo OpenPropInfo =
  463.     {
  464.     FREEVERT | PROPBORDERLESS,
  465.     0, 0,  /* Pots should be reinitialized on the fly */
  466.     0, 0,  /* Bodies should be reinitialized on the fly */
  467.     0, 0, 0, 0, 0, 0,
  468.     };
  469.  
  470. struct Gadget OpenPropGadget =
  471.     {
  472.     &OpenNameTextGadget,
  473.     136, 30 + REQTITLE_HEIGHT,    /* Left, Top */
  474.     13, 30,        /* Width, Height */
  475.     GADGIMAGE | GADGHNONE,         /* Flags */
  476.     GADGIMMEDIATE | RELVERIFY | FOLLOWMOUSE,  /* Activation */
  477.     REQGADGET | PROPGADGET,                /* Type */
  478.     (APTR)&OpenPropImage, 
  479.     NULL,                          /* Renders */
  480.     NULL,
  481.     NULL, 
  482.     (APTR)&OpenPropInfo, 
  483.     OPENGADGET_PROPGADGET, 
  484.     NULL,
  485.     };
  486.  
  487.  
  488.  
  489.  
  490.  
  491. /* === OpenSelectName ==================================================== */
  492.  
  493. struct Gadget OpenSelectNameGadget =
  494.     {
  495.     &OpenPropGadget,
  496.     OPENSELECT_LEFT, OPENSELECT_TOP,        /* Left, Top */
  497.     OPENSELECT_WIDTH, OPENSELECT_HEIGHT,    /* Width, Height */
  498.     GADGHNONE,                                /* Flags */
  499.     GADGIMMEDIATE,                            /* Activation */
  500.     REQGADGET | BOOLGADGET,                    /* Type */
  501.     NULL, NULL,                                /* Renders */
  502.     NULL,                                    /* Text */
  503.     NULL, NULL, 
  504.     OPENGADGET_SELECTNAME,
  505.     NULL,
  506.     };
  507.  
  508.  
  509.  
  510. /* === Requester Details ================================================= */
  511. /* This data is used to render the requester more prettily. */
  512.  
  513. /* === Line Pairs === */
  514. SHORT Req3BorderData[] =
  515.     {
  516.       1, 0,
  517.     OPEN_WIDTH - 2, 0,
  518.     OPEN_WIDTH - 2, 1,
  519.     OPEN_WIDTH - 1, 1,
  520.     OPEN_WIDTH - 1, 108 + REQTITLE_HEIGHT,
  521.     OPEN_WIDTH - 2, 108 + REQTITLE_HEIGHT,
  522.     OPEN_WIDTH - 2, 109 + REQTITLE_HEIGHT,
  523.       1, 109 + REQTITLE_HEIGHT,
  524.       1, 108 + REQTITLE_HEIGHT,
  525.       0, 108 + REQTITLE_HEIGHT,
  526.       0, 1,
  527.       1, 1,
  528.       1, 0,
  529.     };
  530.  
  531. SHORT Req2BorderData[] =
  532.     {
  533.       1 + 1, 0 + 1,
  534.     OPEN_WIDTH - 2 - 1, 0 + 1,
  535.     OPEN_WIDTH - 2 - 1, 1 + 1,
  536.     OPEN_WIDTH - 1 - 1, 1 + 1,
  537.     OPEN_WIDTH - 1 - 1, 108 - 1 + REQTITLE_HEIGHT,
  538.     OPEN_WIDTH - 2 - 1, 108 - 1 + REQTITLE_HEIGHT,
  539.     OPEN_WIDTH - 2 - 1, 109 - 1 + REQTITLE_HEIGHT,
  540.       1 + 1, 109 - 1 + REQTITLE_HEIGHT,
  541.       1 + 1, 108 - 1 + REQTITLE_HEIGHT,
  542.       0 + 1, 108 - 1 + REQTITLE_HEIGHT,
  543.       0 + 1, 1 + 1,
  544.       1 + 1, 1 + 1,
  545.       1 + 1, 0 + 1,
  546.     };
  547.  
  548. SHORT ReqBorderData[] =
  549.     {
  550.       1 + 2, 0 + 2,
  551.     OPEN_WIDTH - 2 - 2, 0 + 2,
  552.     OPEN_WIDTH - 2 - 2, 1 + 2,
  553.     OPEN_WIDTH - 1 - 2, 1 + 2,
  554.     OPEN_WIDTH - 1 - 2, 108 - 2 + REQTITLE_HEIGHT,
  555.     OPEN_WIDTH - 2 - 2, 108 - 2 + REQTITLE_HEIGHT,
  556.     OPEN_WIDTH - 2 - 2, 109 - 2 + REQTITLE_HEIGHT,
  557.       1 + 2, 109 - 2 + REQTITLE_HEIGHT,
  558.       1 + 2, 108 - 2 + REQTITLE_HEIGHT,
  559.       0 + 2, 108 - 2 + REQTITLE_HEIGHT,
  560.       0 + 2, 1 + 2,
  561.       1 + 2, 1 + 2,
  562.       1 + 2, 0 + 2,
  563.     };
  564.  
  565. SHORT SelectBorderData[] =
  566.     {
  567.     8,   14 + REQTITLE_HEIGHT,
  568.     129, 14 + REQTITLE_HEIGHT,
  569.     130, 15 + REQTITLE_HEIGHT,
  570.     130, 74 + REQTITLE_HEIGHT,
  571.     129, 75 + REQTITLE_HEIGHT,
  572.     8,   75 + REQTITLE_HEIGHT,
  573.     7,   74 + REQTITLE_HEIGHT,
  574.     7,   15 + REQTITLE_HEIGHT,
  575.     8,   14 + REQTITLE_HEIGHT,
  576.     };
  577.  
  578. SHORT TextBorderData[] =
  579.     {
  580.     -1,  -2,
  581.     120, -2,
  582.     121, -1,
  583.     121, 8,
  584.     120, 9,
  585.     -1,  9,
  586.     -2,  8,
  587.     -2,  -1,
  588.     -1,  -2,
  589.     };
  590.  
  591. SHORT PropBorderData[] =
  592.     {
  593.     0,  -3,
  594.     16, -3,
  595.     16, 32,
  596.     0,  32,
  597.     0,  -2,
  598.     15, -2,
  599.     15, -1,
  600.     17, -1,
  601.     17, 30,
  602.     15, 30,
  603.     15, 31,
  604.     1,  31,
  605.     1,  30,
  606.     -1, 30,
  607.     -1, -1,
  608.     -1, 1,
  609.     };
  610.  
  611.  
  612. /* === Borders === */
  613. struct Border Req3Border =
  614.     {
  615.     0, 0,
  616.     1, 0,
  617.     JAM1,
  618.     13,
  619.     &Req3BorderData[0],
  620.     NULL,
  621.     };
  622.  
  623. struct Border Req2Border =
  624.     {
  625.     0, 0,
  626.     2, 0,
  627.     JAM1,
  628.     13,
  629.     &Req2BorderData[0],
  630.     &Req3Border,
  631.     };
  632.  
  633. struct Border ReqBorder =
  634.     {
  635.     0, 0,
  636.     1, 0,
  637.     JAM1,
  638.     13,
  639.     &ReqBorderData[0],
  640.     &Req2Border,
  641.     };
  642.  
  643. struct Border SelectBorder =
  644.     {
  645.     0, 0,
  646.     1, 0,
  647.     JAM1,
  648.     9,
  649.     &SelectBorderData[0],
  650.     &ReqBorder,
  651.     };
  652.  
  653. struct Border Text3Border =
  654.     {
  655.     157, 65 + REQTITLE_HEIGHT,
  656.     1, 0,
  657.     JAM1,
  658.     9,
  659.     &TextBorderData[0],
  660.     &SelectBorder,
  661.     };
  662.  
  663. struct Border Text2Border =
  664.     {
  665.     157, 41 + REQTITLE_HEIGHT,
  666.     1, 0,
  667.     JAM1,
  668.     9,
  669.     &TextBorderData[0],
  670.     &Text3Border,
  671.     };
  672.  
  673. struct Border TextBorder =
  674.     {
  675.     157, 16 + REQTITLE_HEIGHT,
  676.     1, 0,
  677.     JAM1,
  678.     9,
  679.     &TextBorderData[0],
  680.     &Text2Border,
  681.     };
  682.  
  683. struct Border PropBorder =
  684.     {
  685.     134, 30 + REQTITLE_HEIGHT,
  686.     1, 0,
  687.     JAM1,
  688.     16,
  689.     &PropBorderData[0],
  690.     &TextBorder,
  691.     };
  692.  
  693. /* === RJ wants to know:  Some Requester Text For You? === */
  694. UBYTE *DefaultReqTitle = (UBYTE *)"File IO Requester";
  695. struct IntuiText ReqTitleText =
  696.     {
  697.     1, 0, 
  698.     JAM2,
  699.     0, 5,        /* The x-coordinate is initialized to center the title */
  700.     &SafeFont,
  701.     NULL,        /* Points to the title supplied in the FileIOSupport */
  702.     NULL,
  703.     };
  704.  
  705. struct IntuiText SelectText =
  706.     {
  707.     1, 0, 
  708.     JAM2,
  709.     18, 6 + REQTITLE_HEIGHT,
  710.     &SafeFont,
  711.     (UBYTE *)"Select a Name",
  712.     &ReqTitleText,
  713.     };
  714.  
  715. struct IntuiText Type3Text =
  716.     {
  717.     1, 0, 
  718.     JAM2,
  719.     201, 55 + REQTITLE_HEIGHT,
  720.     &SafeFont,
  721.     (UBYTE *)"Disk",
  722.     &SelectText,
  723.     };
  724.  
  725. struct IntuiText Type2Text =
  726.     {
  727.     1, 0, 
  728.     JAM2,
  729.     193, 31 + REQTITLE_HEIGHT,
  730.     &SafeFont,
  731.     (UBYTE *)"Drawer",
  732.     &Type3Text,
  733.     };
  734.  
  735. struct IntuiText TypeText =
  736.     {
  737.     1, 0, 
  738.     JAM2,
  739.     161, 6 + REQTITLE_HEIGHT,
  740.     &SafeFont,
  741.     (UBYTE *)"Or Type a Name",
  742.     &Type2Text,
  743.     };
  744.  
  745.  
  746.  
  747. /* === Main Data ======================================================== */
  748. struct ReqSupport OpenReqSupport = 
  749.     {
  750.  
  751.     /* struct Requester Requester; */
  752.         {
  753.         /*    struct Requester *OlderRequest;*/
  754.         NULL,
  755.  
  756.         /*    SHORT LeftEdge, TopEdge;*/
  757.         OPEN_LEFT, OPEN_TOP,
  758.  
  759.         /*    SHORT Width, Height;*/
  760.         OPEN_WIDTH, OPEN_HEIGHT, 
  761.  
  762.         /*    SHORT RelLeft, RelTop;*/
  763.         0, 0,
  764.  
  765.         /*    struct Gadget *ReqGadget;*/
  766.         &OpenSelectNameGadget,
  767.     
  768.         /*    struct Border *ReqBorder;*/
  769.         &PropBorder,
  770.     
  771.         /*    struct IntuiText *ReqText;*/
  772.         &TypeText,
  773.     
  774.         /*    USHORT Flags;*/
  775.         NOISYREQ,
  776.  
  777.         /*    UBYTE BackFill;*/
  778.         0,
  779.  
  780.         /*    struct ClipRect ReqCRect;*/
  781.         { NULL },
  782.  
  783.         /*    struct BitMap *ImageBMap;*/
  784.         NULL,
  785.  
  786.         /*    struct BitMap ReqBMap;*/
  787.         { NULL },
  788.  
  789.         },    /* end of Requester structure */
  790.  
  791.     /* struct Window *Window; */
  792.     NULL,
  793.  
  794.     /* LONG (*StartRequest)(); */
  795.     NULL,
  796.  
  797.     /* LONG (*ReqHandler)(); */
  798.     NULL,
  799.  
  800.     /* LONG (*NewDiskHandler)(); */
  801.     NULL,
  802.  
  803.     /* LONG (*KeyHandler)(); */
  804.     NULL,
  805.  
  806.     /* LONG (*MouseMoveHandler)(); */
  807.     NULL,
  808.  
  809.     /* SHORT SelectedGadgetID; */
  810.     0,
  811. };
  812.  
  813. struct Requester *OpenReq = NULL;
  814. struct Window *OpenReqWindow = NULL;
  815. struct FileIOSupport *OpenReqFileIO = NULL;
  816. UBYTE OpenUndoBuffer[MAX_NAME_LENGTH];
  817. UBYTE OpenLockName[128] = {0};
  818.  
  819. ULONG OpenSaveLock = NULL;
  820.  
  821. UBYTE CurrentDiskString[] = ":";
  822.  
  823. LONG OpenClickSeconds;
  824. LONG OpenClickMicros;
  825.  
  826.